package com.example.shaoying.yuejian.model;


import com.example.shaoying.yuejian.common.Constants;
import com.example.shaoying.yuejian.javabean.ClubCourse;
import com.example.shaoying.yuejian.javabean.ClubInfo;
import com.example.shaoying.yuejian.javabean.ClubList;
import com.example.shaoying.yuejian.javabean.ClubVideo;
import com.example.shaoying.yuejian.javabean.Train;
import com.example.shaoying.yuejian.javabean.TrainInfo;
import com.example.shaoying.yuejian.service.clubeService;
import com.example.shaoying.yuejian.service.userService;

import java.util.List;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/19.
 */

public class ClubeModel {
    private Retrofit retrofit;
    public ClubeModel(){
                retrofit = new Retrofit.Builder()
                .baseUrl(Constants.SERVERADDRESS)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call getClubeList(){
       clubeService  service=retrofit.create(clubeService.class);
        return service.getClubList();
    }
    public Call getNearClubeList(){
        clubeService  service=retrofit.create(clubeService.class);
        return service.getNearClubList();
    }
    public Call<List<Train>>getlistsTraining(){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getlistsTraining();
    }

    public Call<TrainInfo> getTtainInfo(String id){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getTrainInfo(id);
    }
    public Call<ClubInfo> getClubeInfo(String id){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getClubInfo(id);
    }

    public Call<ClubCourse>getClubCourse(String id,String map){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getClubCourse(id,map);
    }
    public Call<ClubVideo>getClubVide(String id, String map){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getClubVideo(id,map);
    }
    public Call<String>joinTrain(String participantname, String train_id,String participanttel, String adultnum,String paytype, String pay,String paynotice,String userID, String SessionID){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.joinTrain(participantname,train_id,participanttel, adultnum, paytype, pay, paynotice,userID,SessionID);
    }

    public Call<String>guanzhu(String SessionID, String userid,String fan_id, String fans_type){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.gunazhu(SessionID,userid,fan_id,fans_type);
    }

    public Call<Integer>getClubState(String fan_id, String userid,String fan_type,String SessonID){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.getClubState(fan_id,userid,fan_type,SessonID);
    }

    public Call<String>delete(String mod, String club_id,String user_id){
        clubeService listsService=retrofit.create(clubeService.class);
        return listsService.delete(mod,club_id,user_id);
    }


}
